//
//  HistoryTableViewCell.m
//  Double
//
//  Created by dllo on 15/5/29.
//  Copyright (c) 2015年 袁庆秋. All rights reserved.
//

#import "HistoryTableViewCell.h"

@implementation HistoryTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        
        self.imageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 30 + _y + 60)];
        self.imageView1.layer.cornerRadius = 20;
        self.imageView1.clipsToBounds = YES;
        self.imageView1.userInteractionEnabled = YES;
        
        self.imageView1.image = [UIImage imageNamed:@"background.jpg"];
        [self.contentView addSubview:self.imageView1];
        
        
        
        self.imageview = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 40, 40)];
        //        图片变成圆角
        self.imageview.layer.cornerRadius = 20;
        self.imageview.clipsToBounds = YES;
        //        名字
        self.alabel = [[UILabel alloc]initWithFrame:CGRectMake(60, 10, 300, 30)];
        
        //        内容
        self.label = [[UILabel alloc] initWithFrame:CGRectZero];
        _label.numberOfLines = 0;
        
        self.view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 80 + _y, [UIScreen mainScreen].bounds.size.width, 30)];
        
        
        self.LastView = [[CellView alloc] initWithFrame:CGRectMake(0, 0, self.view1.frame.size.width / 4, 30)];
        self.LastView.image.image = [UIImage imageNamed:@"5.png"];
        //        self.LastView.backgroundColor = [UIColor greenColor];
        [self.view1 addSubview:self.LastView];
        self.LastView1 = [[CellView alloc] initWithFrame:CGRectMake(self.view1.frame.size.width / 4, 0, self.view1.frame.size.width / 4, 30)];
        //        self.LastView1.backgroundColor = [UIColor orangeColor];
        self.LastView1.image.image = [UIImage imageNamed:@"6.png"];
        
        
        [self.view1 addSubview:self.LastView1];
        
        self.LastView2 = [[CellView alloc] initWithFrame:CGRectMake(self.view1.frame.size.width / 4 * 2, 0, self.view1.frame.size.width / 4, 30)];
        //        self.LastView2.backgroundColor = [UIColor blackColor];
        self.LastView2.image.image = [UIImage imageNamed:@"3.png"];
        
        [self.view1 addSubview:self.LastView2];
        
        UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(self.view1.frame.size.width / 4 * 3, 0, self.view1.frame.size.width / 4, 30)];
        [button setImage:[UIImage imageNamed:@"4.png"] forState:UIControlStateNormal];
        [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
        [self.view1 addSubview:button];
        
//        [self.imageView1 addSubview:_view1];
        [self.imageView1 addSubview:self.imageview];
        [self.imageView1 addSubview:self.alabel];
        [self.imageView1 addSubview:self.label];
        //        [self setAlabelFrame];
        
    }
    return self;
}

- (void)setAlabelFrame
{
    //
    [self.imageView1 setFrame:CGRectMake(5, 0, [UIScreen mainScreen].bounds.size.width - 10, 30 + _y + 80)];
    
    [self.label setFrame:CGRectMake(20, 60, 335, _y)];
    [self.view1 setFrame:CGRectMake(0, 80 + _y, [UIScreen mainScreen].bounds.size.width, 30)];
    
}
- (void)buttonAction:(id)sender
{
    NSLog(@"%@", self.share);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    
}


@end
